/**
 * 增强的代码生成配置类型定义
 */

import type { CodeGenerationConfig } from "../templates/backend-frameworks"

// 对象存储配置
export interface ObjectStorageConfig {
  type: "minio" | "s3" | "oss" | "cos" | "qiniu"
  config: {
    endpoint?: string
    accessKey?: string
    secretKey?: string
    bucketName?: string
    region?: string
    [key: string]: any
  }
}

// 搜索引擎配置
export interface SearchEngineConfig {
  type: "elasticsearch" | "solr"
  config: {
    hosts?: string
    url?: string
    indexPrefix?: string
    username?: string
    password?: string
    collection?: string
    [key: string]: any
  }
}

// 消息队列配置
export interface MessageQueueConfig {
  type: "rabbitmq" | "kafka" | "rocketmq" | "activemq"
  config: {
    host?: string
    port?: number
    username?: string
    password?: string
    virtualHost?: string
    bootstrapServers?: string
    groupId?: string
    nameServer?: string
    groupName?: string
    [key: string]: any
  }
}

// 部署配置
export interface DeploymentConfig {
  devPort: number
  prodPort: number
  containerPort: number
  jvmMemory: string
  nodeVersion?: string
  pythonVersion?: string
  baseImage: string
  deploymentType?: string // 部署方式：jar, pm2, systemd, gunicorn, etc.
}

// 增强的功能特性配置
export interface EnhancedFeatures {
  enableSwagger: boolean
  enableSecurity: boolean
  enableCache: boolean
  enableDocker: boolean
  enableMonitoring: boolean
}

// 增强的代码生成配置
export interface EnhancedCodeGenerationConfig extends Omit<CodeGenerationConfig, "features"> {
  features: EnhancedFeatures
  objectStorage?: ObjectStorageConfig
  searchEngine?: SearchEngineConfig
  messageQueue?: MessageQueueConfig
  deployment: DeploymentConfig
}

// 数据库选项
export interface DatabaseOption {
  type: string
  name: string
  description: string
  icon: string
  features: string[]
}

// 技术组件选项
export interface TechOption {
  type: string
  name: string
  description: string
  icon: string
}
